home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
mintprgs
/
mintupgr
/
disk7.zoo
/
elvis.zoo
/
usr
/
doc
/
elvis
/
options.doc
< prev
next >
Wrap
Text File
|
1992-08-12
|
28KB
|
793 lines
_5. _O_P_T_I_O_N_S
Options may be set or examined via the colon command
"set". The values of options will affect the operation of
later commands.
For convenience, options have both a long descriptive
name and a short name which is easy to type. You may use
either name interchangably. I like the short names, myself.
There are three types of options: Boolean, string, and
numeric. Boolean options are made TRUE by giving the name
of the option as an argument to the "set" command; they are
made FALSE by prefixing the name with "no". For example,
"set autoindent" makes the autoindent option TRUE, and "set
noautoindent" makes it FALSE. Elvis also allows boolean
options to be toggled by prefixing the name with "neg". So,
":map g :set neglist^M" will cause the <g> key to alter-
nately toggle the "list" option on and off. (The "neg" pre-
fix is an extension; the real vi doesn't support it.)
To change the value of a string or numeric option, pass
the "set" command the name of the option, followed by an "="
sign and the option's new value. For example, "set
tabstop=8" will give the tabstop option a value of 8. For
string options, you may enclose the new value in quotes.
NAMES TYPE DEFAULT MEANING
autoindent, ai Bool noai auto-indent during input
autoprint, ap Bool ap in EX, print the current line
autotab, at Bool at auto-indent allowed to use tabs?
autowrite, aw Bool noaw auto-write when switching files
beautify, bf Bool nobf strip control chars from file?
charattr, ca Bool noca interpret \fX sequences?
cc, cc Str cc="cc -c" name of the C compiler
columns, co Num co=80 width of the screen
digraph, dig Bool nodig recognize digraphs?
directory, dir Str dir="/usr/tmp"where tmp files are kept
edcompatible, ed Bool noed remember ":s//" options
equalprg, ep Bool ep="fmt" program to run for = operator
errorbells, eb Bool eb ring bell on error
exrc, exrc Bool noexrc read "./.exrc" file?
exrefresh, er Bool er write lines indiviually in EX
flash, vbell Bool flash use visible alternative to bell
flipcase, fc Str fc="" non-ASCII chars flipped by ~
hideformat, hf Bool hf hide text formatter commands
ignorecase, ic Bool noic upper/lowercase match in search
inputmode, im Bool noim start vi in insert mode?
keytime, kt Num kt=2 timeout for mapped key entry
keywordprg, kp Str kp="ref" full pathname of shift-K prog
lines, ln Num ln=25 number of lines on the screen
list, li Bool noli display lines in "list" mode
magic, ma Bool ma use regular expression in search
make, mk Str mk="make" name of the "make" program
August 10, 1992
5-2 OPTIONS 5-2
mesg, ms Bool ms allow messages from other users?
modelines, ml Bool noml are modelines processed?
more, more Bool more pause between messages?
novice, nov Bool nonovice set options for ease of use
paragraphs, para Str para="PPppIPLPQP"names of "paragraph" nroff cmd
prompt, pr Bool pr show ':' prompt in _e_x mode
readonly, ro Bool noro prevent overwriting of orig file
remap, rem Bool remap allow key maps to call key maps
report, re Num re=5 report when 5 or more changes
ruler, ru Bool noru display line/column numbers
scroll, sc Num sc=12 scroll amount for ^U and ^D
sections, sect Str sect="NHSHSSSEse"names of "section" nroff cmd
shell, sh Str sh="/bin/sh" full pathname of the shell
showmatch, sm Bool nosm show matching ()[]{}
showmode, smd Bool nosmd say when we're in input mode
shiftwidth, sw Num sw=8 shift amount for < and >
sidescroll, ss Num ss=8 amount of sideways scrolling
sync, sy Bool nosy call sync() often
tabstop, ts Num ts=8 width of tab characters
taglength, tl Num tl=0 significant chars in tag name
term, te Str te="$TERM" name of the termcap entry
terse, tr Bool notr give shorter error messages
timeout, to Bool to distinguish <esc> from <arrow>?
warn, wa Bool wa warn for ! if file modified
window, wi Num wi=24 lines to redraw after long move
wrapmargin, wm Num wm=0 wrap long lines in input mode
wrapscan, ws Bool ws at EOF, searches wrap to line 1
writeany, wr Bool nowr allow :w to clobber files
autoindent, ai
During input mode, the autoindent option will cause
each added line to begin with the same amount of lead-
ing whitespace as the line above it. Without autoin-
dent, added lines are initially empty.
autoprint, ap
This option only affects EX mode. If the autoprint
option on, and either the cursor has moved to a dif-
ferent line or the previous command modified the file,
then Elvis will print the current line.
autotab, at
This option affects the behaviour of the autoindent
mode. If autoindent is turned off, then autotab has no
effect.
When autotab is turned on, elvis will use a mixture of
spaces and tabs to create the proper amount of indenta-
tion. This is the default.
When autotab is turned off, elvis will only use spaces
for auto-indent. Elvis will still insert a real tab
character when you hit the <Tab> key, though; the
August 10, 1992
5-3 OPTIONS 5-3
autotab option only affects _a_u_t_o_m_a_t_i_c indentation.
autowrite, aw
When you're editing one file and decide to switch to
another - via the :tag command, or :next command,
perhaps - if your current file has been modified, then
Elvis will normally print an error message and refuse
to switch.
However, if the autowrite option is on, then Elvis will
write the modified version of the current file and suc-
cessfully switch to the new file.
beautify, bf
This option causes all control characters to be deleted
from the text file, at the time when you start editing
it. If you're already editing a file when you turn on
the beautify option, then that file won't be affected.
cc The :cc command runs the C compiler. This option
should be set to the name of your compiler.
charattr, ca
Many text formatting programs allow you to designate
portions of your text to be underlined, italicized, or
boldface by embedding the special strings \fU, \fI, and
\fB in your text. The special string \fP marks the end
of underlined or boldface text.
Elvis normally treats those special strings just like
any other text.
However, if the charattr option is on, then Elvis will
interpret those special strings correctly, to display
underlined or boldface text on the screen. (This only
works, of course, if your terminal can display under-
lined and boldface, and if the TERMCAP entry says how
to do it.)
columns, co
This option shows how wide your screen is.
digraph, dig
This option is used to enable/disable recognition of
digraphs. The default value is nodigraph, which means
that digraphs will not be recognized.
directory, dir
Elvis stores text in temporary files. This option
allows you to control which directory those temporary
files will appear in. The default is /usr/tmp.
This option can only be set in a .exrc file; after
that, Elvis will have already started making temporary
August 10, 1992
5-4 OPTIONS 5-4
files in some other directory, so it would be too late.
edcompatible, ed
This option affects the behaviour of the
":s/regexp/text/options" command. It is normally off
(:se noed) which causes all of the substitution options
to be off unless explicitly given.
However, with edcompatible on (:se ed), the substitu-
tion command remembers which options you used last
time. Those same options will continue to be used
until you change them. In edcompatible mode, when you
explicitly give the name of a substitution option, you
will toggle the state of that option.
This all seems very strange to me, but its implementa-
tion was almost free when I added the ":&" command to
repeat the previous substitution, so there it is.
equalprg, ep
This holds the name & arguments of the external filter
program used the the visual = operator. The defualt
value is "fmt", so the = operator will adjust line
breaks in text.
errorbells, eb
Elvis normally rings a bell when you do something
wrong. This option lets you disable the bell.
exrc This option specifies whether a .exrc file in the
current directory should be executed. By default, this
option is off (":set noexrc") which prevents elvis from
executing .exrc in the current directory. If the .exrc
file in your home directory turns this option on (":set
exrc") then the Elvis will attempt to execute the .exrc
file in the current directory.
This option exist mainly for security reasons. A
mean-spirited person could do something like
echo >/tmp/.exrc '!rm -rf $HOME'
and then anybody who attempted to edit or view a file
in the /tmp directory would lose most of their files.
With the exrc option turned off, this couldn't happen
to you.
exrefresh, er
The EX mode of Elvis writes many lines to the screen.
You can make Elvis either write each line to the screen
separately, or save up many lines and write them all at
once.
The exrefresh option is normally on, so each line is
written to the screen separately.
August 10, 1992
5-5 OPTIONS 5-5
You may wish to turn the exrefresh option off (:se
noer) if the "write" system call is costly on your
machine, or if you're using a windowing environment.
(Windowing environments scroll text a lot faster when
you write many lines at once.)
This option has no effect in visual command mode or
input mode.
flash, vbell
If your termcap entry describes a visible alternative
to ringing your terminal's bell, then this option will
say whether the visible version gets used or not. Nor-
mally it will be.
If your termcap does NOT include a visible bell capa-
bility, then the flash option will be off, and you
can't turn it on.
flipcase, fc
The flipcase option allows you to control how the non-
ASCII characters are altered by the "~" command.
The string is divided into pairs of characters. When
"~" is applied to a non-ASCII character, Elvis looks up
the character in the flipcase string to see which pair
it's in, and replaces it by the other character of the
pair.
hideformat, hf
Many text formatters require you to embed format com-
mands in your text, on lines that start with a "."
character. Elvis normally displays these lines like
any other text, but if the hideformat option is on,
then format lines are displayed as blank lines.
ignorecase, ic
Normally, when Elvis searches for text, it treats
uppercase letters as being different for lowercase
letters.
When the ignorecase option is on, uppercase and lower-
case are treated as equal.
inputmode, im
This option allows you to have Elvis start up in insert
mode. You can still exit insert mode at any time by
hitting the ESC key, as usual. Usually, this option
would be set in your ".exrc" file.
keytime, kt
The arrow keys of most terminals send a multi-character
sequence. It takes a measurable amount of time for
these sequences to be transmitted. The keytime option
August 10, 1992
5-6 OPTIONS 5-6
allows you to control the maximum amount of time to
allow for an arrow key (or other mapped key) to be
received in full.
On most systems, the setting is the number of tenths of
a second to allow between characters. On some other
systems, the setting is in whole seconds.
Try to avoid setting keytime=1. Most systems just
count clock beats, so if you tried to read a character
shortly before a clock beat, you could allow almost no
time at all for reading the characters. For higher
keytime settings, the difference is less critical.
If your system's response time is poor, you might want
to increase the keytime. In particular, I've found
that when keystrokes must be sent through a network
(via X windows, rlogin, or telnet, for example) the
keytime should be set to at least 1 second.
As a special case, you can set keytime to 0 to disable
this time limit stuff altogether. The big problem here
is: If your arrow keys' sequences start with an ESC,
then every time you hit your ESC key Elvis will wait...
and wait... to see if maybe that ESC was part of an
arrow key's sequence.
NOTE: this option is a generalization of the timeout
option of the real vi.
keywordprg, kp
Elvis has a special keyword lookup feature. You move
the cursor onto a word, and hit shift-K, and Elvis uses
another program to look up the word and display infor-
mation about it.
This option says which program gets run.
The default value of this option is "ref", which is a
program that looks up the definition of a function in
C. It looks up the function name in a file called
"refs" which is created by ctags.
You can subtitute other programs, such as an English
dictionary program or the online manual. Elvis runs
the program, using the keyword as its only argument.
The program should write information to stdout. The
program's exit status should be 0, unless you want
Elvis to print "<<< failed >>>".
lines, ln
This option says how many lines you screen has.
list, li
August 10, 1992
5-7 OPTIONS 5-7
In nolist mode (the default), Elvis displays text in a
"normal" manner -- with tabs expanded to an appropriate
number of spaces, etc.
However, sometimes it is useful to have tab characters
displayed differently. In list mode, tabs are
displayed as "^I", and a "$" is displayed at the end of
each line.
magic, ma
The search mechanism in Elvis can accept "regular
expressions" -- strings in which certain characters
have special meaning.
The magic option is normally on, which causes these
characters to be treated specially.
If you turn the magic option off (:se noma), then all
characters except ^ and $ are treated literally. ^ and
$ retain their special meanings regardless of the set-
ting of magic.
make, mk
The :make command runs your "make" program. This
option defines the name of your "make" program.
mesg With the real vi, running under real UNIX, ":set
nomesg" would prevent other users from sending you mes-
sages. Elvis ignores it, though.
modelines, ml
Elvis supports modelines. Modelines are lines near the
beginning or end of your text file which contain
"ex:yowza:", where "yowza" is any EX command. A typi-
cal "yowza" would be something like "set ts=5 ca
kp=spell wm=15". Other text may also appear on a mode-
line, so you can place the "ex:yowza:" in a comment:
/* ex:set sw=4 ai: */
Normally these lines are ignored, for security reasons,
but if you have "set modelines" in your .exrc file then
"yowza" is executed.
novice, nov
The command ":set novice" is equivelent to ":set
nomagic report=1 showmode".
paragraphs, pa
The { and } commands move the cursor forward or back-
ward in increments of one paragraph. Paragraphs may be
separated by blank lines, or by a "dot" command of a
text formatter. Different text formatters use
August 10, 1992
5-8 OPTIONS 5-8
different "dot" commands. This option allows you to
configure Elvis to work with your text formatter.
It is assumed that your formatter uses commands that
start with a "." character at the front of a line, and
then have a one- or two-character command name.
The value of the paragraphs option is a string in which
each pair of characters is one possible form of your
text formatter's paragraph command.
more When Elvis must display a sequence of messages at the
bottom line of the screen in visual mode, it normally
pauses after all but the last one, so you have time to
read them all.
If you turn off the "more" option, then Elvis will not
pause. This means you can only read the last message,
but it is usually the most important one anyway.
prompt, pr
If you ":set noprompt", then Elvis will no longer emit
a ':' when it expects you to type in an _e_x command.
This is slightly useful if you're using an astonish-
ingly slow UNIX machine, but the rest of us can just
ignore this one.
readonly, ro
Normally, Elvis will let you write back any file to
which you have write permission. If you don't have
write permission, then you can only write the changed
version of the file to a _d_i_f_f_e_r_e_n_t file.
If you set the readonly option, then Elvis will pretend
you don't have write permission to _a_n_y file you edit.
It is useful when you really only mean to use Elvis to
look at a file, not to change it. This way you can't
change it accidentally.
This option is normally off, unless you use the "view"
alias of Elvis. "View" is like "vi" except that the
readonly option is on.
remapThe ":map" command allows you to convert one key
sequence into another. The remap option allows you to
specify what should happen if portions of that other
sequence are also in the map table. If remap is on,
then those portions will also be mapped, just as if
they had been typed on the keyboard. If remap is off,
then the matching portions will not be mapped.
For example, if you enter the commands ":map A B" and
":map B C", then when remap is on, A will be converted
to C. But when remap is off, A will be converted only
August 10, 1992
5-9 OPTIONS 5-9
to B.
report, re
Commands in Elvis may affect many lines. For commands
that affect a lot of lines, Elvis will output a message
saying what was done and how many lines were affected.
This option allows you to define what "a lot of lines"
means. The default is 5, so any command which affects
5 or more lines will cause a message to be shown.
ruler, ru
This option is normally off. If you turn it on, then
Elvis will constantly display the line/column numbers
of the cursor, at the bottom of the screen.
scroll, sc
The ^U and ^D keys normally scroll backward or forward
by half a screenful, but this is adjustable. The value
of this option says how many lines those keys should
scroll by. If you invoke ^U or ^D with a count argu-
ment (for example, "33^D") then this option's value is
set to the count.
sections, se
The [[ and ]] commands move the cursor backward or for-
ward in increments of 1 section. Sections may be del-
imited by a { character in column 1 (which is useful
for C source code) or by means of a text formatter's
"dot" commands.
This option allows you to configure Elvis to work with
your text formatter's "section" command, in exectly the
same way that the paragraphs option makes it work with
the formatter's "paragraphs" command.
shell, sh
When Elvis forks a shell (perhaps for the :! or :shell
commands) this is the program that is uses as a shell.
This is "/bin/sh" by default, unless you have set the
SHELL (or COMSPEC, for MS-DOS) environment variable, it
which case the default value is copied from the
environment.
shiftwidth, sw
The < and > commands shift text left or right by some
uniform number of columns. The shiftwidth option
defines that "uniform number". The default is 8.
showmatch, sm
With showmatch set, in input mode every time you hit
one of )}], Elvis will momentarily move the cursor to
the matching ({[.
showmode, smd
August 10, 1992
5-10 OPTIONS 5-10
In visual mode, it is easy to forget whether you're in
the visual command mode or input/replace mode. Nor-
mally, the showmode option is off, and you haven't a
clue as to which mode you're in. If you turn the
showmode option on, though, a little message will
appear in the lower right-hand corner of your screen,
telling you which mode you're in.
sidescroll, ss
For long lines, Elvis scrolls sideways. (This is dif-
ferent from the real vi, which wraps a single long line
onto several rows of the screen.)
To minimize the number of scrolls needed, Elvis moves
the screen sideways by several characters at a time.
The value of this option says how many characters'
widths to scroll at a time.
Generally, the faster your screen can be redrawn, the
lower the value you will want in this option.
sync, sy
If the system crashes during an edit session, then most
of your work can be recovered from the temporary file
that Elvis uses to store changes. However, sometimes
the OS will not copy changes to the hard disk immedi-
ately, so recovery might not be possible. The [no]sync
option lets you control this.
In nosync mode (which is the default, for UNIX), Elvis
lets the operating system control when data is written
to the disk. This is generally faster.
In sync mode (which is the default for MS-DOS, Amiga-
Dos, and Atari TOS), Elvis forces all changes out to
disk every time you make a change. This is generally
safer, but slower. It can also be a rather rude thing
to do on a multi-user system.
tabstop, ts
Tab characters are normally 8 characters wide, but you
can change their widths by means of this option.
taglength, tl
This option allows you to specify how many characters
of a tag's name must match when performing tag lookup.
As a special case, ":set taglength=0" means that all
characters of a tag's name must match.
Note: some configurations of Elvis don't support this
option.
term, te
This read-only option shows the name of the termcap
August 10, 1992
5-11 OPTIONS 5-11
entry that Elvis is using for your terminal.
terse, tr
The real vi uses this option to select longer vs.
shorter error messages. Elvis has only one set of
error messages, though, so this option has no effect.
timeout, to
The command ":set notimeout" is equivelent to ":set
keytime=0", and ":set timeout" is equivelent to ":set
keytime=1". This affects the behaviour of the <Esc>
key. See the discussion of the "keytime" option for
more information.
warn, wa
If you have modified a file but not yet written it back
to disk, then Elvis will normally print a warning
before executing a ":!cmd" command. However, in nowarn
mode, this warning is not given.
Elvis also normally prints a message after a successful
search that wrapped at EOF. The [no]warn option can
also disable this warning.
window, wi
This option controls how many lines are redrawn after a
long move.
On fast terminals, this is usually set to the number of
rows that the terminal can display, minus one. This
causes the entire screen to be filled with text around
the cursor.
On slow terminals, you may wish to reduce this value to
about 7 or so. That way, if you're doing something
like repeatedly hitting 'n' to search for each
occurrence of some string and trying to find a particu-
lar occurrence, then you don't need to wait as long for
Elvis to redraw the screen after each search.
wrapmargin, wm
Normally (with wrapmargin=0) Elvis will let you type in
extremely long lines, if you wish.
However, with warpmargin set to something other that 0
(wrapmargin=10 is nice), Elvis will automatically cause
long lines to be "wrapped" on a word break for lines
come too close to the right-hand margin. For example:
On an 80-column screen, ":set wm=10" will cause lines
to wrap when their length exceeds 70 columns.
wrapscan, ws
Normally, when you search for something, Elvis will
find it no matter where it is in the file. Elvis
August 10, 1992
5-12 OPTIONS 5-12
starts at the cursor position, and searches forward.
If Elvis hits EOF without finding what you're looking
for, then it wraps around to continue searching from
line 1. If you turn off the wrapscan option (:se
nows), then when Elvis hits EOF during a search, it
will stop and say so.
writeany, wr
With "writeany" turned off, elvis will prevent you from
accidentally overwriting a file. For example, if "foo"
exists then ":w foo" will fail. If you turn on the
"writeany" option, then ":w foo" will work.
Regardless of the setting of "writeany", though, ":w!
foo" will work. The '!' forces the ":w" command to
write the file unless the operating system won't allow
it.
August 10, 1992